<?php


namespace app\api\controller\xiluedu;


use app\common\controller\Api;
use app\common\model\xiluedu\CustomMade AS CustomMadeModel;
use app\common\model\xiluedu\UserCustomMade;
use think\Exception;

class CustomMade extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = ['*'];

    /**
     * 定制内容查询
     */
    public function lists(){
        $lists = CustomMadeModel::lists();
        $this->success('查询成功',$lists);
    }


    /**
     * 定制提交
     */
    public function made(){
        $params = $this->request->post('');
        try {
            $result = UserCustomMade::add($params);
        }catch (Exception $exception){
            $this->error($exception->getMessage());
        }
        $this->success('保存成功',$result);
    }

}